
function ShowQMenu()
	MENU = vgui.Create( "DFrame" )
	MENU:SetSize( ScrW()*0.1, ScrH()*0.6 )
	MENU:SetPos(ScrW()*0.8,ScrH()*0.2)
	MENU:SetTitle( "Ultima GMOD" ) // Name of Fram
	MENU:SetVisible( true )
	MENU:SetDraggable( true ) //Can the player drag the frame /True/False
	MENU:ShowCloseButton( true ) //Show the X (Close button) /True/False
	MENU:MakePopup()
	
	INVENTORY = vgui.Create( "DFrame" )
	INVENTORY:SetSize( ScrW()*0.3, ScrH()*0.3 )
	INVENTORY:SetPos(ScrW()*0.1,ScrH()*0.1)
	INVENTORY:SetTitle( "Inventory" ) // Name of Fram
	INVENTORY:SetVisible( true )
	INVENTORY:SetDraggable( true ) //Can the player drag the frame /True/False
	INVENTORY:ShowCloseButton( true ) //Show the X (Close button) /True/False
	INVENTORY:SetParent(MENU)
	INVENTORY:MakePopup()
	
	PLAYERINFO = vgui.Create( "DFrame" )
	PLAYERINFO:SetSize( ScrW()*0.3, ScrH()*0.3 )
	PLAYERINFO:SetPos(ScrW()*0.1,ScrH()*0.415)
	PLAYERINFO:SetTitle( "Player Information" ) // Name of Fram
	PLAYERINFO:SetVisible( true )
	PLAYERINFO:SetDraggable( true ) //Can the player drag the frame /True/False
	PLAYERINFO:ShowCloseButton( true ) //Show the X (Close button) /True/False
	PLAYERINFO:SetParent(MENU)
	PLAYERINFO:MakePopup()	
	
	MODEL = vgui.Create("DModelPanel")
	MODEL:SetParent(PLAYERINFO)
	MODEL:SetModel(LocalPlayer():GetModel())
	MODEL:SetSize(ScrW()*0.2, ScrH()*0.2)
	MODEL:SetAnimated(true)
	MODEL:SetFOV(75)
	MODEL:SetAnimSpeed(1)
	MODEL:SetColor(Color(255,255,255,255))
	MODEL:Paint()

end 

function HideQMenu()
	MENU:Close()
end

-- Press q
function GM:OnSpawnMenuOpen( )
	ShowQMenu()
	gui.EnableScreenClicker( true )
	RestoreCursorPosition( )
end

-- Unpress q
function GM:OnSpawnMenuClose( )
	HideQMenu()
	RememberCursorPosition( )
	gui.EnableScreenClicker( false )
end